package com.wang.exception_hw2;

public class Test {
    public static void main(String[] args) {
        Account account = new Account(1000);
        CheckingAccount checkingAccount = new CheckingAccount(1000,500);
        try {
            account.withdraw(1500);
        } catch (OverdraftException e) {
            System.out.println(e.getMessage() + "透支额度为：" + e.getDeficit());
        }
        try {
            checkingAccount.withdraw(3000);
        } catch (OverdraftException e) {
            System.out.println(e.getMessage() + "透支额度为：" + e.getDeficit());
        }
    }
}
